<template>
    <div class="kgo-layedit-content-sty" v-bind:style="{ height: height +'px'}">
        <textarea class="layui-textarea" v-model="content" :id="name+'-layeditId'" style="display: none"></textarea>
    </div> 
</template>

<script>


export default {
   props:{
      name:{
          default:"layeidt"
      },
      height:{
          default:"450"
      },
      content:{
        default:""
      }
    },
     data () {
        return {
            layeditIndex:null,
        }
    },
   mounted(){
       this.initLayEdit();
   },
   methods:{
      initLayEdit:function(){
         this.layeditIndex = layui.layedit.build(this.name+'-layeditId',{
            height:this.height-50
         });
      },
      getHtml:function(){
          return layui.layedit.getContent(this.layeditIndex);
      },
      emptyEdit:function(){
       
      }
   },
   watch: {
    content (newValue, oldValue) {
      this.initLayEdit();
    }
  }
}
</script>

<style lang="scss">
.kgo-layedit-content-sty{
    margin-bottom: 20px; 
    width: 100%;
    background-color: #FFFFFF;
}
</style>
